# Maintainer: David Runge <dave@sleepmap.de>

pkgname=zita-dc1
pkgver=0.3.3
pkgrel=2
pkgdesc="Dynamics Compressor"
arch=('loong64' 'x86_64')
url="https://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html"
license=('GPL3')
groups=('pro-audio')
depends=('cairo' 'clxclient' 'clthreads' 'jack')
makedepends=('gendesk')
source=("https://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pkgname}-${pkgver}.tar.bz2")
sha512sums=('044a32b2ba6f9971397a3014da4f0588f04c7971d76a099d49f711226a1bb45de61f53ed1d417a5feee6acaabbe81a6254b6d50b884501cb9b96e83401ea5b1d')

prepare() {
  cd "$pkgname-$pkgver"
  # strip march=native
  sed -e '/native/d' \
      -i source/Makefile
  # XDG desktop file
  gendesk -n \
          --pkgname ${pkgname} \
          --pkgdesc "${pkgdesc}" \
          --name ${pkgname} \
          --categories "AudioVideo;Audio"
}

build() {
  cd "$pkgname-$pkgver"
  make -C source PREFIX=/usr
}

package() {
  cd "$pkgname-$pkgver"
  make -C source PREFIX=/usr DESTDIR="$pkgdir/" install
  # XDG desktop integration
  install -vDm 644 "${pkgname}.desktop" \
    -t "${pkgdir}/usr/share/applications/"
  install  -vDm 644 AUTHORS -t "${pkgdir}/usr/share/doc/${pkgname}"
}
